$(function () {
  $("#download").click(function () {
  });

  //console.log($("#dataset").data('dataset-id'));
  // $("#delete-verify").find("button:eq(1)").click(function () {
  //   $.requestJSON({
  //     url: Urls.resolve('api_v1_management:dataset_delete'),
  //     method: 'POST',
  //     data: {dataset_ids: [$("#dataset").data('dataset-id')]},
  //     onSuccess(data){
  //       console.log('Success');
  //       window.location.assign(Urls.resolve('management:my_datasets'))
  //     }
  //   });
  // });
});

// 20181125 wxf

$(function () {
  function setBasicInfo(data) {
    // $('#d-title').text(data.title || '');
    $('#d-title').text(data.title);
    $('#submitter').text(data.author);
    $('#ispublic').text(data.is_public);
    $('#abstract').text(data.abstract || '');
    // $('#submitter').text(data.add_time || '');
    // $('#d-author').text(data.author || '');
  }

  function setDetailInfo(data) {
    $('#attributes').text(data.rows);
    $('#records').text(data.cols);
    $('#nou').text(data.ref_count);
  }

  $.requestJSON({
    method: 'GET',
    url: Urls.resolve('storage_api_v1:dataset_detail', { pk: window.location.href.split('/').pop() }),
    onSuccess: function (json) {
      // console.log(json);
      setBasicInfo(json.data);
      //setContentInfo(json.data);
        //最新注释 显示模板的具体内容
      // $('#data-content-inner').html(DataRender(json.data.template.content, json.data.content));
      setDetailInfo(json.data);
    },
    onError: function () {
      window._jqHandled = true;
    }
  });
});